import Vue from 'vue'
import Cookies from 'js-cookie'
import 'normalize.css/normalize.css' // A modern alternative to CSS resets
import Element from 'element-ui'
import 'element-ui/lib/theme-chalk/index.css'
import 'view-design/dist/styles/iview.css'// iview 的全局样式
import './styles/index.scss'
// import '@/styles/index.scss' // global css
import App from './App'
import router from './router'
import store from './store'
import qs from 'qs'
import './icons' // icon
import './permission' // permission control  权限控制
import * as filters from './filters' // global filters
import publicMethods from './utils/publicMethods'
import permission from '@/directive/permission/index.js' // 权限判断指令
import Print from '@/utils/print' // 打印
import VueClipboard from 'vue-clipboard2'
// import ViewUI from 'view-design';
import 'view-design/dist/styles/iview.css';
//全局注册自定义table组件，方便页面引用
import MCTable from './components/common/Table.vue'
import { globalMethods } from './mixin'
import toast from './utils/toast'
import * as math from 'mathjs'
Vue.component('MCTable',MCTable)
// 全局页面公共函数mixin
Vue.prototype.toast = toast
Vue.prototype.$qs = qs
Vue.prototype.$math = math
Vue.mixin(globalMethods)
Vue.use(VueClipboard)
Vue.use(Print)
Vue.use(publicMethods)
// Vue.use(ViewUI)
Vue.use(Element, {
  size: Cookies.get('size') || 'medium' // set element-ui default size
})
Vue.directive('permission', permission)
// register global utility filters.
Object.keys(filters).forEach(key => {
  Vue.filter(key, filters[key])
})

Vue.config.productionTip = false

new Vue({
  el: '#app',
  router,
  store,
  render: h => h(App)
})
